home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr48
/
ppascal.zip
/
SPIRAL2.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-04-24
|
1KB
|
39 lines
program spiral2;
{ makes a really neeto spiral of a random color }
uses
Crt, Graph;
const
width = 3; { width of the line: 1 = narrow, 3 = wide }
finalDiam = 2000; { the final diameter of the spiral }
betweenWidth = 70; { distance between the lines (inverse) }
startingradius = 1; { initial spiral radius }
var
graphDriver,
ErrorCode,
GraphMode : integer;
radius : integer;
x : integer;
ch : char;
begin
graphdriver := detect;
InitGraph( Graphdriver, GraphMode, 'c:\utils\tp');
ErrorCode := Graphresult;
if errorcode <> grOk then halt(1);
randomize;
setcolor ( random (getmaxColor - 1 ) + 1 ); {sets color of spiral }
setlinestyle( 0, 0, width);
x := 0;
radius := startingradius;
repeat
{ sound(radius+100);}
arc ( 320, 240, x, x+betweenwidth, radius );
inc ( x, betweenwidth );
inc ( radius );
if x = 360 then x := 0;
until ( radius = finaldiam ) or ( keypressed);
if keypressed then ch := readkey;
nosound;
ch := readkey;
closegraph;
end.